package com.qf.listener;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author lyx
 * @date 2022/7/4 21:26
 */
//将这个类注册到spring容器中 作为一个javabean
@Component
//监听的mq队列名字
@RabbitListener(queues = "testQueue4")
public class Listener4 {
    @RabbitHandler
    public void messageHandler(String str){
        System.out.println("监听器4"+str);
    }
}
